package com.gali.juc;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

/**
 * @Auther: gali
 * @Date: 2022-08-25 16:12
 * @Description:
 */
class Customer{
    int id;
    boolean flag = false;
    boolean flag1 = false;
}
public class JOLDemo {
    public static void main(String[] args) {
//        System.out.println(VM.current().details());//JVM的详细情况
//
//        System.out.println(VM.current().objectAlignment());//所有对象分配的字节都是8的整数倍

        Object o = new Object();
        Customer customer = new Customer(); //16bytes
        //System.out.println(ClassLayout.parseInstance(o).toPrintable());
        System.out.println(ClassLayout.parseInstance(customer).toPrintable());
    }
}
